<?php
namespace app\index\model;
use think\Model;
use think\Db;
class AdminModel extends Model{
	function getPowers(){
		$where=array(
			'parent_id'=>1
		);
		$powers=Db::name("jtsc_power")->where($where)->select();
		$powers_list=array();
		foreach($powers as $key=>$p){
			$powers_list[$p['en_name']]=$p['en_name'];
		}
		
		return $powers_list;
	}
	function checkAdmin($user_id){
		$flag=0;
		$where=array(
		'uid'=>$user_id
		);
		$res=Db::name("jtsc_admin")->where($where)->find();
		if($res['power']==1){
			$flag=1;
		}
		return $flag;
	}
}
?>